<h1 align="center">OSSEAN数据监控</h1>
<div style="margin-top: 20px">
<table width="100%" style="text-align: center; border: thin " border="1px">
	<tr style="font-size: 16px; font-weight: 2px">
		<td width="9%">站点</td>
		<td width="9%">类别</td>
		<td width="9%">本日爬取量</td>
		<td width="9%">本周爬取量</td>
		<td width="9%">本月爬取量</td>
		<td width="9%">本日抽取量</td>
		<td width="9%">本周抽取量</td>
		<td width="9%">本月抽取量</td>
		<td width="9%">站点数据总量</td>
		<td width="9%">站点数据流动量</td>
		<td>站点数据流动率</td>
	</tr>
	
	<% @ossean_monitors.each do |item| %>
	<tr>
		<% if (item.day_crawler == 0 && item.week_crawler == 0) && (item.day_extractor == 0 && item.week_extractor == 0) && (item.category != 'project')%>
		<td bgcolor="#ff0000"><%=item.website %></td>
		<td bgcolor="#ff0000"><%=item.category %></td>
		<% elsif (item.day_crawler == 0 && item.week_crawler == 0) && (item.day_extractor == 0 && item.week_extractor == 0) && (item.category == 'project')%>
		<td bgcolor="#ff00ff"><%=item.website %></td>
		<td bgcolor="#ff00ff"><%=item.category %></td>
		<% else%>
		<td><%=item.website %></td>
		<td><%=item.category %></td>
		<% end%>
		
		
		<% if (item.day_crawler == 0 && item.week_crawler == 0) && (item.category != 'project') %>
		<td bgcolor="#ff0000"><%=item.day_crawler %></td>
		<td bgcolor="#ff0000"><%=item.week_crawler %></td>
		<td bgcolor="#ff0000"><%=item.month_crawler %></td>
		<% elsif (item.day_crawler == 0 && item.week_crawler == 0) && (item.category == 'project')%>
		<td bgcolor="#ff00ff"><%=item.day_crawler %></td>
		<td bgcolor="#ff00ff"><%=item.week_crawler %></td>
		<td bgcolor="#ff00ff"><%=item.month_crawler %></td>
		<% else%>
		<td><%=item.day_crawler %></td>
		<td><%=item.week_crawler %></td>
		<td><%=item.month_crawler %></td>
		<% end%>
		
		<% if(item.day_extractor == 0 && item.week_extractor == 0) && (item.category != 'project')%>
		<td bgcolor="#ff0000"><%=item.day_extractor %></td>
		<td bgcolor="#ff0000"><%=item.week_extractor %></td>
		<td bgcolor="#ff0000"><%=item.month_extractor %></td>
		<% elsif(item.day_extractor == 0 && item.week_extractor == 0) && (item.category == 'project')%>
		<td bgcolor="#ff00ff"><%=item.day_extractor %></td>
		<td bgcolor="#ff00ff"><%=item.week_extractor %></td>
		<td bgcolor="#ff00ff"><%=item.month_extractor %></td>
		<% else%>
		<td><%=item.day_extractor %></td>
		<td><%=item.week_extractor %></td>
		<td><%=item.month_extractor %></td>
		<% end%>
		
		<% if (item.day_crawler == 0 && item.week_crawler == 0) && (item.day_extractor == 0 && item.week_extractor == 0) && (item.category != 'project')%>
		<td bgcolor="#ff0000"><%=item.total_num %></td>
		<% elsif (item.day_crawler == 0 && item.week_crawler == 0) && (item.day_extractor == 0 && item.week_extractor == 0) && (item.category == 'project')%>
		<td bgcolor="#ff00ff"><%=item.total_num %></td>
		<% else%>
		<td><%=item.total_num %></td>
		<% end%>		
		
		<!-- 增加数据流动监控 -->
		<% if(item.flow_num == '0' && item.category != 'project')%>
		<td bgcolor="#ff0000"><%=item.flow_num%></td>
		<td bgcolor="#ff0000"><%=(item.flow_rate*1000).to_i/10%>%</td>
		<% elsif(item.flow_num == '0' && item.category == 'project')%>
		<td bgcolor="#ff00ff"><%=item.flow_num%></td>
		<td bgcolor="#ff00ff"><%=(item.flow_rate*1000).to_i/10%>%</td>
		<% else%>
		<td><%=item.flow_num%></td>
		<td><%=(item.flow_rate*1000).to_i/10%>%</td>
		<% end%>
	</tr>
	<% end %>
</table>
</div>


<script type="text/javascript">
	function myrefresh() { 
       window.location.reload(); 
	} 
	setTimeout('myrefresh()',30000); //指定30秒刷新一次 
	
</script>
